<?php

class Payment_status_model extends CI_Model{
	
	public function __construct(){
		parent::__construct();
	}
	
	function create(){
		$data = array(
					'name' => $this->input->post('name'),
					'description' => $this->input->post('description')
				);
		$this->db_front->insert('payment_status', $data);	
	}
	
	function getAll($page='', $limit=''){
		if(!empty($limit))
		$this->db_front->limit($limit,$page);
		$query = $this->db_front->get('payment_status');
		if($query -> num_rows() > 0){
			foreach ($query -> result() as $rows){
				$data[] = $rows;	
			}	
			return $data;
		}	
	}
	
	function update($payment_status_id){
		$data = array(
					'name' => $this->input->post('name'),
					'description' => $this->input->post('description')
				);
        $this->db_front->where('payment_status_id', $payment_status_id);
        $this->db_front->update('payment_status', $data);
	}
	
	function select($payment_status_id){
        return $this->db_front->get_where('payment_status', array('payment_status_id'=>$payment_status_id))->row();
    }
	
	function delete($payment_status_id){
		$this->db_front->delete('payment_status', array('payment_status_id'=>$payment_status_id));
	}
	
}

?>